<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="base/mainBase::head('智能机柜一体化监控平台',~{::link},~{::script},~{::style})">

    <link rel="stylesheet" th:href="${session.basePath}+'/resource/main/plugins/layui/css/layui.css'" media="all" />
    <link rel="stylesheet" th:href="${session.basePath}+'/resource/main/css/global.css'" media="all">
    <link rel="stylesheet" th:href="${session.basePath}+'/resource/main/plugins/font-awesome/css/font-awesome.min.css'">
    <script type="text/javascript" th:src="${session.basePath}+'/pages/emms/base/js/statusFormat.js'"></script>
</head>

<body>
<div class="layui-layout layui-layout-admin" >
    <div class="layui-header header header-demo">
        <div class="layui-main">
            <div class="admin-login-box">
                <a class="logo" style="left: 0;" href="javascript:void(0)">
                    <img th:src="${session.basePath}+'/resource/main/images/ic_title_logo.png'"/>
                </a>
            </div>
            <ul class="layui-nav admin-header-item">

                <li class="layui-nav-item  userInfo_li">
                    <a href="javascript:;" class="admin-header-user">
                        <img id="head_user_header" th:src="${session.basePath}+'/resource/main/images/touxiang_bg.png'" />
                        <div class="user_info_box">
                            <p class="head_user_name" id="head_user_name"></p>
                            <p class="head_user_departent" id="head_user_departent"></p>
                        </div>
                    </a>
                    <div class="layui-nav-child head_userinfo_slide">
                        <div class="head_userinfo_top">
                            <img id="head_userinfo_header" class="head_userinfo_header" th:src="${session.basePath}+'/resource/main/images/touxiang_bg.png'" />
                            <p id="head_userinfo_username" class="head_userinfo_username"></p>
                            <input type="button" class="edit_userInfo_btn" id="edit_userInfo_btn" value="详细资料编辑"/>
                        </div>
                        <div class="head_userinfo_content">
                            <form class="layui-form" action="">
                                <label class="layui-form-label">所属单位：</label>
                                <div class="layui-input-block head_userinfo_input">
                                    <div class="head_userrole" id="userDepartment" >

                                    </div>
                                </div>

                                <label class="layui-form-label">所属项目：</label>
                                <div class="layui-input-block head_userinfo_input">
<!--                                    <%&#45;&#45;<div class="head_userrole" id="userProject" >&#45;&#45;%>-->

<!--                                    <%&#45;&#45;</div>&#45;&#45;%>-->
                                    <select name="city" lay-filter="userProject" id="userProject" lay-verify="required">
                                        <option value=""></option>
                                        <option value="0">北京</option>
                                        <option value="1">上海</option>
                                        <option value="2">广州</option>
                                        <option value="3">深圳</option>
                                        <option value="4">杭州</option>
                                    </select>
                                </div>
                                <label class="layui-form-label">所属标段：</label>
                                <div class="layui-input-block head_userinfo_input">
                                    <div class="head_userrole" id="userSection">

                                    </div>
                                </div>
                                <label class="layui-form-label" >担任角色：</label>
                                <div class="layui-input-block head_userinfo_input">
                                    <div class="head_userrole" id="head_userrole">

                                    </div>
                                </div>
                            </form>

                        </div>
                        <div class="head_userinfo_bottom">
                            <a href="javascript:void(0)" onclick="loginOut();">安全退出系统</a>
                        </div>
                    </div>
                </li>
                <li class="layui-nav-item message_li" id="message_li">

                    <img th:src="${session.basePath}+'/resource/main/images/ic_notice_title.png'"/>
                    <span class="head_message_info" id="head_message_info"></span>
                    <div class="msg_tishi" id="msg_tishi"></div>
                </li>
                <li class="layui-nav-item faq_li" onclick="toFaq(this)">

                    <img th:src="${session.basePath}+'/resource/main/images/ic_FAQ_title.png'"/>
                    <span class="head_faq_info">帮助/FAQ</span>

                </li>
            </ul>
            <ul class="layui-nav admin-header-item-mobile">
                <li class="layui-nav-item">
                    <a href="javascript:void(0)"><i class="fa fa-sign-out" onclick="loginOut();" aria-hidden="true"></i> 注销</a>
                </li>
            </ul>
        </div>
    </div>
    <div class="layui-side layui-bg-black" id="admin-side">

        <div class="layui-side-scroll" id="layui-side-scroll" >
            <div class="admin-side-toggle_box" id="admin-side-toggle_box">
                <div class="admin-side-toggle">

                </div>
            </div>
            <div class="admin-navbar-side-box">
                <div id="admin-navbar-side" lay-filter="side"></div>
                <div class="sub_meun" id="sub_meun">
                    <div class="sub_menu_tit" id="sub_menu_tit"></div>
                    <div class="sub_menu_list" id="sub_menu_list"></div>
                </div>
            </div>
        </div>
        <div class="sub_menu_scroll" id="sub_menu_scroll"></div>
    </div>
    <div class="layui-body" style="bottom: 0;" id="admin-body">

        <div class="layui-tab admin-nav-card layui-tab-brief" lay-filter="admin-tab">
            <ul class="layui-tab-title">
                <li class="layui-this">
                    <i class="fa fa-dashboard" aria-hidden="true"></i>
                    <cite>首页</cite>
                </li>
            </ul>
            <div class="layui-tab-content" style="min-height: 150px; padding: 5px 0 0 0;">
                <div class="layui-tab-item layui-show">
                    <iframe th:src="${session.basePath}+'/pages/home.jsp'"></iframe>
                </div>
            </div>
        </div>
    </div>

    <div class="site-tree-mobile layui-hide">
        <i class="layui-icon">&#xe602;</i>
    </div>
    <div class="site-mobile-shade"></div>


</div>
<script type="text/javascript" th:src="${session.basePath}+'/resource/main/plugins/layui/layui.js'"></script>
<!--<script type="text/javascript" th:src="${session.basePath}+'/resource/main/datas/nav.js'"></script>-->
<!--<script th:src="${session.basePath}+'/pages/imp/msg/js/msgProc.js'" type="text/javascript"></script>-->
<script th:src="${session.basePath}+'/pages/imp/msg/js/msg.js'" type="text/javascript"></script>
<script th:src="${session.basePath}+'/pages/imp/msg/js/messageTypeEnum.js'" type="text/javascript"></script>
<script th:src="${session.basePath}+'/pages/main/js/index.js'"></script>
<script type="text/javascript">
    layui.use('layer', function() {
        var $ = layui.jquery,
            layer = layui.layer;
        // $.ajax({
        //     url:basePath+"gzmli/user/getCurrentUser",
        //     //processData: false,
        //     //data: xmlDocument,
        //     dataType:"json",
        //     type: "post",
        //     contentType:"application/x-www-form-urlencoded",
        //     beforeSend:null,
        //     success:function(data){
        //         data = data.data;
        //         userInfo = data;
        //         if(userInfo.headerpath){
        //             $('#head_user_header').attr("src",userImg+"/"+userInfo.headerpath);
        //             $("#head_userinfo_header").attr("src",userImg+"/"+userInfo.headerpath)
        //         }
        //
        //         $("#head_user_departent").html(userInfo.userOrg[0].orgName);
        //         $("#head_user_name").html(userInfo.name);
        //         $("#head_userinfo_username").html(userInfo.name);
        //         var userProjectHtml = "";
        //         for(var i = 0;i < data.userProject.length;i++){
        //             if(data.userProject[i].projectName){
        //                 if(i == 0){
        //                     userProjectHtml +="<option value='"+data.userProject[i].projectId+"' selected='selected'>"+data.userProject[i].projectName+"</option>";
        //                 }else{
        //                     userProjectHtml +="<option value='"+data.userProject[i].projectId+"'>"+data.userProject[i].projectName+"</option>";
        //                 }
        //
        //             }
        //
        //
        //         }
        //         $("#userProject").html(userProjectHtml);
        //         var userSectionHtml = "";
        //         for( var i=0;i<data.userProjectSection.length;i++){
        //             if(data.userProjectSection[i].sectionName){
        //                 userSectionHtml +="<span>"+data.userProjectSection[i].sectionName+"</span>";
        //             }
        //
        //         }
        //         $("#userSection").html(userSectionHtml);
        //         var userRoleHtml = "";
        //         for( var i=0;i<data.roles.length;i++){
        //             if(data.roles[i].name){
        //                 userRoleHtml +="<span>"+data.roles[i].name+"</span>";
        //             }
        //
        //         }
        //         $("#head_userrole").html(userRoleHtml);
        //         var userOrg = ""
        //         for( var i=0;i<data.userOrg.length;i++){
        //             if(data.userOrg[i].orgName){
        //                 userOrg +="<span>"+data.userOrg[i].orgName+"</span>";
        //             }
        //
        //         }
        //         $("#userDepartment").html(userOrg);
        //         layui.use('form', function(){
        //             var form = layui.form();
        //             form.on('select(userProject)', function(selData){
        //                 $.ajax({
        //                     url:basePath+"gzmli/user/setUserCurrentProject",
        //                     //processData: false,
        //                     data: {projectId:selData.value},
        //                     async:true,
        //                     dataType:"json",
        //                     type: "POST",
        //                     contentType:"application/x-www-form-urlencoded",
        //                     beforeSend:null,
        //                     success:function(data){
        //                         if (data.status == 1) {
        //
        //
        //                         }
        //                     },
        //                     error:function (XMLHttpRequest, textStatus, errorThrown) {
        //
        //                     }
        //                 });
        //             });
        //         });
        //     }});


        $("#userInfo_btn").on('click',function () {
            layer.open({
                title: '个人信息',
                maxmin: true,
                type: 2,
                content: basePath + '/pages/personal/personal.jsp',
                area: ['1100px', '700px']
            });
        });


        // initWebSocket(basePath);
    });

    function loginOut(){
        setTimeout(function(){
            $.ajax({
                url:basePath+"/system/logout",
                //processData: false,
                //data: xmlDocument,
                async:true,
                dataType:"json",
                type: "POST",
                contentType:"application/x-www-form-urlencoded",
                beforeSend:null,
                success:function(data){
                    if (data.status == 1) {

                        window.parent.location.href=basePath+formateUrl("/imp/system/login/login");

                    }
                },
                error:function (XMLHttpRequest, textStatus, errorThrown) {

                    $.wdfProgress.showMsg("服务器异常或网络超时！",$("body"),true);

                }
            });
        },500);

    }
    window.onload = function (ev) {
        setTimeout(function () {
            $('#admin-side').animate({
                width: '180px'
            },300);
            $("#admin-body").animate({
                left:"180px"
            },300)
        },50)
    }
</script>

</body>

</html>
